package activity;

import java.io.IOException;


import shared.PMF;

import javax.servlet.ServletException;
import javax.servlet.http.*;
import javax.jdo.PersistenceManager;


public class AddShop extends HttpServlet {
	private static final long serialVersionUID = 1L;
	private static final String nextJSP = "/getActivity.jsp";

	public void doGet(HttpServletRequest request, HttpServletResponse response)
            throws IOException, ServletException {

		request.setCharacterEncoding("utf-8");
		
        
		//String productID = request.getParameter("PNO");
        
		String actShop = request.getParameter("actShop");
		
		
		try {
							
			
			
		}
		catch (NumberFormatException e){
			//implementation is needed
		}
		PersistenceManager pm = PMF.get().getPersistenceManager();
		try{
			Shop s = new Shop(actShop);				
			pm.makePersistent(s);
			
		} finally {
		    pm.close();
		}
		
		response.sendRedirect(nextJSP);
		
    }
	public void doPost(HttpServletRequest request, HttpServletResponse response) 
			throws IOException, ServletException{
		doGet(request, response);
	}
}